import { createRouter, createWebHashHistory } from "vue-router";
import commonRoutes from "./commonRoutes";
import beforeEachHooks from "./beforeEachHooks";

// 创建路由
const router = createRouter({
    history: createWebHashHistory(),
    routes: commonRoutes
});

// 添加导航前置守卫
Object.values(beforeEachHooks).forEach(hook=>{
    router.beforeEach(hook)
})

export default router